<admintpl file="header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:U('Admin/LiveCompetitor/index')}">选手列表</a></li>
			<li><a href="{:U('Admin/LiveCompetitor/add')}">添加选手</a></li>
		</ul>
		<form class="well form-search" id="query_form" method="post" action="{:U('Admin/LiveCompetitor/index')}">
		    ID： 
			<input type="text" name="id" style="width: 120px;" value="{$formParam.id}" placeholder="选手ID...">
			姓名： 
			<input type="text" name="name" style="width: 120px;" value="{$formParam.name}" placeholder="选手姓名...">
			性别： 
			<select class="select_2" name="sex" style="width: 90px;">
				<option value='-1'>全部</option>
				<option value='1' <if condition="$formParam.sex eq 1"> selected </if>>男</option>
				<option value='2' <if condition="$formParam.sex eq 2"> selected </if>>女</option>
			</select>
			绰号： 
			<input type="text" name="nickname" style="width: 120px;" value="{$formParam.nickname}" placeholder="选手绰号...">
			<input type="button" name="query_form_btn" id="queryBtn" data-action="{:U('Admin/LiveCompetitor/index')}" class="btn btn-primary" value="查询" />
		</form>
		<form class="js-ajax-form" action="" method="post">
		<table class="table table-hover table-bordered">
			<thead>
				<tr>
				    <th>ID</th>
					<th>姓名</th>
					<th>性别</th>
					<th>绰号</th>
					<th>打赏人数</th>
					<th>人气值</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
			    <php>
					 $sex = array("1"=>'男',"2"=>'女');
				</php>
				<foreach name="data" item="vo">
				<tr>
				    <td>{$vo.competitor_id}
				    <a style="float:right;" href='javascript:void(1);' data-clipboard-text="{$vo.competitor_id}" href="javascript:;" class="link_url" >复制</a>
					<td>{$vo.real_name}</td>
					<td>{$sex[$vo['sex']]}</td>
					<td>{$vo.nickname}</td>
					<td><a href='{:U("Admin/LiveCompetitor/prop_info",array("competitor_id"=>$vo["competitor_id"]))}'>{$vo.prop_count}</a></td>
					<td><if condition="$vo.popular_value neq ''">{$vo.popular_value}<else/>0</if></td>
					<td>
					    <a href='{:U("Admin/LiveCompetitor/edit",array("competitor_id"=>$vo["competitor_id"]))}' >修改</a>
						<a href='{:U("Admin/LiveCompetitor/delete",array("competitor_id"=>$vo["competitor_id"]))}' class="js-ajax-dialog-btn">删除</a>
					</td>
				</tr>
				</foreach>
			</tbody>
		</table>
		</form>
		<div class="pagination">{$page}</div>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
	<script type="text/javascript" src="__PUBLIC__/js/ueditor/third-party/zeroclipboard/ZeroClipboard.min.js"></script>
	<script>
	$(document).ready(function(){
		$('input[name="query_form_btn"]').click(function(){
			 $('#query_form').attr('action', $(this).attr('data-action'));
			 $('#query_form').submit();
		});
		var clip = new ZeroClipboard($("td .link_url"));
		clip.on("aftercopy", function(e){
		    alert('复制成功！');
		});
	});
	
	</script>
</body>
</html>